import {axios} from '@/utils/request.js';

/**
 * 列表查询
 * @param data 传入参数
 * @returns {AxiosPromise}
 */
export function getList(data) {
    return axios({
        url: "/transactionFlowInvoice/list", // 自己写的
        method: 'post',
        data
    })
}

/**
 * 根据交易流程获取发票信息
 *
 * @param data 请求参数
 * @returns 返回axios请求结果
 */
export function getInvoiceInfoByTransactionFlow(data) {
    return axios({
        url: "/transactionFlowInvoice/getInvoiceInfoByTransactionFlow",
        method: 'post',
        data
    })
}

/**
 * 交易流水开票-流水开票(专票)
 *
 * @param data 请求参数
 * @returns 返回axios请求结果
 */
export function invoiceByTransactionFlow01(data) {
    return axios({
        url: "/vatoutinv/transactionFlowInvoice/invoiceByTransactionFlow01",
        method: 'post',
        data
    })
}

/**
 * 交易流水开票-流水开票(普通发票)
 *
 * @param data 请求参数
 * @returns 返回axios请求结果
 */
export function invoiceByTransactionFlow02(data) {
    return axios({
        url: "/transactionFlowInvoice/invoiceByTransactionFlow02",
        method: 'post',
        data
    })
}

/**
 * 交易流水-拆分流水
 * @param data
 * @returns {AxiosPromise}
 */
export function splitTransactionFlow(data) {
    return axios({
        url: "/transactionFlowInvoice/splitTransactionFlow",
        method: 'post',
        data
    })
}

/**
 * 交易流水-合并查询
 * @param data
 * @returns {AxiosPromise}
 */

export function mergeListQuery(data) {
    return axios({
        url: "/transactionFlowInvoice/mergeQuery",
        method: 'post',
        data
    })
}

/**
 * 交易流水开票-流水预合并
 * @param data
 * @returns {AxiosPromise}
 */
export function preMergeAxios(data) {
    return axios({
        url: "/transactionFlowInvoice/preMerge",
        method: 'post',
        data
    })
}

/**
 * 交易流水开票-确定合并
 * @param data
 * @returns {AxiosPromise}
 */
export function merge(data) {
    return axios({
        url: "/transactionFlowInvoice/merge",
        method: 'post',
        data
    })
}

/**
 * 交易流水-校验流水是否开票
 * @param id
 * @returns {AxiosPromise}
 */
export function checkFlowInvoiceStatus(id) {
    return axios({
        url: "/transactionFlowInvoice/checkFlowInvoiceStatus?id=" + id,
        method: 'post'
    })
}
/**
 * 交易流水-获取合并 拆分信息,单个
 * @param id
 * @returns {AxiosPromise}
 */
export function getMergeSplitInfo(id) {
    return axios({
        url: "/transactionFlowInvoice/getMergeSplitInfo?rdid=" + id,
        method: 'post'
    })
}
/**
 * 交易流水-获取合并 拆分列表 分页
 * @param id
 * @returns {AxiosPromise}
 */
export function getMergeSplitItem(data) {
    return axios({
        url: "/transactionFlowInvoice/getMergeSplitItem",
        method: 'post',
        data
    })
}

/**
 * 交易流水-还原 流水
 * @param id
 * @returns {AxiosPromise}
 */
export function restoreFlow(id) {
    return axios({
        url: "/transactionFlowInvoice/restoreFlow?rdid=" + id,
        method: 'post'
    })
}



